#pragma once

#include <QObject>
#include <QString>
#include <QMap>

class SubFrame;
class QMainWindow;
class QStackedWidget;
class QActionGroup;
class QAction;
class QToolBar;

class WidgetGroup: public QObject
{
    Q_OBJECT
public:
	WidgetGroup(QMainWindow* pParent, const QString& name);
	void AddChild(const QString& iconName, const QString& label, SubFrame* pFrame); 
	QStackedWidget* StackedWidget();
	void SetCurrentWidget(QWidget* pWidget);
	SubFrame* CurrentWidget();
public:
	~WidgetGroup(void);
private slots:
	void ActionClicked(QAction* action);
private:
	QStackedWidget*	m_pWidgetStack;
	QActionGroup*	m_pActionGroup;
	QToolBar*		m_pToolBar;
typedef QMap<QAction*, QWidget*> WidgetMap;
	WidgetMap		m_widgetMap;
};
